package com.xuecheng.order.controller;

import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.web.exceptions.BusinessException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xuecheng.order.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 订单支付信息前端控制器
 * </p>
 *
 * @author 七安
 */
@Slf4j
@RestController
@RequestMapping("/payment")
public class PaymentController {

    @Autowired
    private PaymentService paymentService;

    /**
     * 获取支付url
     *
     * @param orderNo 订单号
     * @return 结果
     */
    @GetMapping("/createPay")
    public ResponseResult<String> getPayUrl(String orderNo) throws BusinessException {
        return paymentService.getPayUrl(orderNo);
    }
}
